function Utf8Decode(_input){
var result = new Array();
var _q3 = false;
var _q2 = false;
var _q1 = false;
var _q0 = false;
var _r = 0x0;
for (var _i = 0; _i < _input.length; _i++) {
var _c = _input.charCodeAt(_i);
if ((!_q3 && !_q2 && !_q1 && !_q0)){
if (String.fromCharCode(_c).match(/^([\0-\x7F])$/)){
_q3 = false;
_q2 = false;
_q1 = false;
_q0 = false;
result.push(String.fromCharCode(_c));
_r = 0x0;
}
else {
if (String.fromCharCode(_c).match(/^([\xC2-\xDF])$/)){
_q3 = false;
_q2 = false;
_q1 = true;
_q0 = true;
_r = ((_c & 0x3F) << 0x6);
}
else {
if ((_c == 0xE0)){
_q3 = false;
_q2 = true;
_q1 = true;
_q0 = true;
_r = 0x0;
}
else {
if ((_c == 0xED)){
_q3 = false;
_q2 = true;
_q1 = true;
_q0 = false;
_r = 0x0;
}
else {
if (String.fromCharCode(_c).match(/^([\xE1-\xEC\xEE\xEF])$/)){
_q3 = false;
_q2 = false;
_q1 = true;
_q0 = false;
_r = ((_c & 0x1F) << 0xC);
}
else {
if (String.fromCharCode(_c).match(/^([\xF1-\xF3])$/)){
_q3 = false;
_q2 = false;
_q1 = false;
_q0 = true;
_r = ((_c & 0x7) << 0x8);
}
else {
if ((_c == 0xF0)){
_q3 = false;
_q2 = true;
_q1 = false;
_q0 = false;
_r = 0x0;
}
else {
if ((_c == 0xF4)){
_q3 = false;
_q2 = true;
_q1 = false;
_q0 = true;
_r = 0x0;
}
else {
throw {name:'InvalidInput'};
}
}
}
}
}
}
}
}
}
else if ((!_q3 && !_q2 && !_q1 && _q0)){
if (String.fromCharCode(_c).match(/^([\x80-\xBF])$/)){
_q3 = true;
_q2 = false;
_q1 = false;
_q0 = false;
_r = (0xD800 | (((_r | ((_c & 0x30) << 0x2)) - 0x40) | ((_c & 0xF) << 0x2)));
}
else {
throw {name:'InvalidInput'};
}
}
else if ((!_q3 && _q2 && !_q1 && !_q0)){
if (String.fromCharCode(_c).match(/^([\x90-\xBF])$/)){
_q3 = true;
_q2 = false;
_q1 = false;
_q0 = false;
_r = (0xD800 | ((((_c & 0x30) << 0x2) - 0x40) | ((_c & 0xF) << 0x2)));
}
else {
throw {name:'InvalidInput'};
}
}
else if ((!_q3 && _q2 && !_q1 && _q0)){
if (String.fromCharCode(_c).match(/^([\x80-\x8F])$/)){
_q3 = true;
_q2 = false;
_q1 = false;
_q0 = false;
_r = (0xD800 | (((0x400 | ((_c & 0x30) << 0x2)) - 0x40) | ((_c & 0xF) << 0x2)));
}
else {
throw {name:'InvalidInput'};
}
}
else if ((!_q3 && !_q2 && _q1 && !_q0)){
if (String.fromCharCode(_c).match(/^([\x80-\xBF])$/)){
_q3 = false;
_q2 = false;
_q1 = true;
_q0 = true;
_r = (_r | ((_c & 0x3F) << 0x6));
}
else {
throw {name:'InvalidInput'};
}
}
else if ((!_q3 && _q2 && _q1 && !_q0)){
if (String.fromCharCode(_c).match(/^([\x80-\x9F])$/)){
_q3 = false;
_q2 = false;
_q1 = true;
_q0 = true;
_r = (0xD000 | ((_c & 0x3F) << 0x6));
}
else {
throw {name:'InvalidInput'};
}
}
else if ((!_q3 && _q2 && _q1 && _q0)){
if (String.fromCharCode(_c).match(/^([\xA0-\xBF])$/)){
_q3 = false;
_q2 = false;
_q1 = true;
_q0 = true;
_r = ((_c & 0x3F) << 0x6);
}
else {
throw {name:'InvalidInput'};
}
}
else if ((_q3 && !_q2 && !_q1 && !_q0)){
if (String.fromCharCode(_c).match(/^([\x80-\xBF])$/)){
_q3 = false;
_q2 = false;
_q1 = true;
_q0 = true;
result.push(String.fromCharCode((_r | ((_c >> 0x4) & 0x3))));
_r = (0xDC00 | ((_c & 0xF) << 0x6));
}
else {
throw {name:'InvalidInput'};
}
}
else if (true){
if (String.fromCharCode(_c).match(/^([\x80-\xBF])$/)){
_q3 = false;
_q2 = false;
_q1 = false;
_q0 = false;
result.push(String.fromCharCode((_r | (_c & 0x3F))));
_r = 0x0;
}
else {
throw {name:'InvalidInput'};
}
}
}
if (!(!_q3 && !_q2 && !_q1 && !_q0)){
throw {name:'InvalidInput'};
}
return result.join('');
}
